import request from "../utils/request";

export interface IAdminParams {
  adminname: string
  password?: string
  role: number
  checkedKeys: any[]
}

export function getAdminList () {
  return request({
    url: '/admin/list'
  })
}

export function addAdmin (params: IAdminParams) {
  return request({
    url: '/admin/add',
    method: 'POST',
    data: params
  })
}

export function removeAdmin (params: { adminid: string }) {
  return request({
    url: '/admin/delete',
    method: 'POST',
    data: params
  })
}

export function updateAdmin (params: IAdminParams) {
  return request({
    url: '/admin/update',
    method: 'POST',
    data: params
  })
}